const fileProvider = require('../../providers/fileProvider');

const FileService = function () {
    return {
        upload: async(ctx, next) => {
            let appName = ctx.appInfo.appName;
            console.log(`appName:${appName}`);
            let fileUrl = await fileProvider.upload(ctx, appName);
            console.log(`appName:${appName}, fileUrl: ${fileUrl}`);
            ctx.apiBody = fileUrl;
            next();
        }
    }
}();


module.exports = FileService;
